var express = require("express");
var { resolve } = require("path");
var mp = require("./routes/mp");
var api = require("./routes/api");
var db = require("./db");
var { port } = require("./config");
var app = express();
// 设置响应格式
app.use(express.urlencoded());
app.use(express.json());

// 静态资源目录设置
app.use(express.static(resolve(__dirname, "./static")));

// 微信配置
app.use("/mp", mp);
// 接口配置
app.use("/api", api);

app.listen(port, function () {
    console.log("服务已经开启");
});
